home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Utilities / Analyse & Test / System Analysis / System Processes / ProcessWatcher 2.0 / ProcessWatcherSuite.h < prev    next >
Text File  |  1992-12-11  |  4KB  |  146 lines

  1. /* ProcessWatcher AppleEvents Suite
  2.  */
  3.  
  4. #pragma once
  5.  
  6. // PW signature
  7.  
  8. #define kPWSignature        'YgzP'
  9.  
  10. // Event Class
  11.  
  12. #define kAEPWEventClass        kPWSignature
  13.  
  14. // Events
  15.  
  16. #define kAEPWGetProcessList    'glis'
  17. #define kAEPWGetProcessInfo    'ginf'
  18. #define kAEPWKill            'kill'
  19. #define kAEPWBringToFront    'fron'
  20.  
  21. #define keyPWTargetProcess    'prtg'            // typeProcessSerialNumber
  22.  
  23. #define typePWProcessList    'plis'
  24. /*
  25.     typePWProcessList defines an array of ProcessListRec :
  26.  
  27.     typedef struct {
  28.         ProcessSerialNumber    psn;        // Process serial number
  29.         Str31                name;        // Pascal string (process name)
  30.     } ProcessListRec;
  31.  
  32.     The number of processes is given by deviding the data size by
  33.     sizeof(ProcessListRec).
  34.     Be very careful that desk accessories names begin with the NULL
  35.     character, so there may be some problems converting process names
  36.     to C strings.
  37.  */
  38. #define typePWProcessInfo    'pinf'
  39. /*
  40.     typePWProcessInfo defines a ProcessInfoRec record
  41.     size: sizeof(ProcessInfoRec)
  42.     "bug": the processName and processAppSpec field are set to nil,
  43.     but you should already know the name from the get process list
  44.     Apple Event.
  45.     Note: the launch date of the ProcessInfoRec is in fact the real date
  46.     and time when the process was launched, and not the number of ticks elapsed
  47.     between boot and launch.
  48.  */
  49.  
  50. /*
  51. ********************************************************************************
  52. Get processes list
  53. ==================
  54.  
  55. Event Class            kAEPWEventClass
  56. Event ID            kAEPWGetProcessList
  57.  
  58. Parameters
  59. ----------
  60. None
  61.  
  62. Reply parameters
  63. ----------------
  64. keyAEResult            An array of structures giving process serial numbers
  65.                     and name of all processes running on the machine.
  66.                     
  67.                     Descriptor type            typePWProcessList
  68.                     Required
  69.                     Size                    multiple of sizeof(ProcessListRec)
  70.  
  71. keyErrorNumber        The result code for the event
  72.                     Descriptor type            typeLongInteger
  73.                     Optional (the abscence of parameter means no error happened)
  74.                     Size                    4 bytes
  75. ********************************************************************************
  76. Get process info
  77. ================
  78.  
  79. Event Class            kAEPWEventClass
  80. Event ID            kAEPWGetProcessInfo
  81.  
  82. Parameters
  83. ----------
  84. keyDirectObject        The process for which information is desired.
  85.  
  86.                     Descriptor type            typeProcessSerialNumber
  87.                     Required
  88.                     Size                    sizeof(ProcessSerialNumber)
  89.  
  90. Reply parameters
  91. ----------------
  92. keyAEResult            A ProcessInfoRec giving the process information.
  93.                     
  94.                     Descriptor type            typePWProcessInfo
  95.                     Required
  96.                     Size                    sizeof(ProcessInfoRec)
  97.  
  98. keyErrorNumber        The result code for the event
  99.                     Descriptor type            typeLongInteger
  100.                     Optional (the abscence of parameter means no error happened)
  101.                     Size                    4 bytes
  102. ********************************************************************************
  103. Kill process
  104. ============
  105.  
  106. Event Class            kAEPWEventClass
  107. Event ID            kAEPWKill
  108.  
  109. Parameters
  110. ----------
  111. keyDirectObject        The process for which information is desired.
  112.  
  113.                     Descriptor type            typeProcessSerialNumber
  114.                     Required
  115.                     Size                    sizeof(ProcessSerialNumber)
  116.  
  117. Reply parameters
  118. ----------------
  119. keyErrorNumber        The result code for the event
  120.                     Descriptor type            typeLongInteger
  121.                     Optional (the abscence of parameter means no error happened)
  122.                     Size                    4 bytes
  123. ********************************************************************************
  124. Bring process to front
  125. ======================
  126.  
  127. Event Class            kAEPWEventClass
  128. Event ID            kAEPWBringToFront
  129.  
  130. Parameters
  131. ----------
  132. keyDirectObject        The process for which information is desired.
  133.  
  134.                     Descriptor type            typeProcessSerialNumber
  135.                     Required
  136.                     Size                    sizeof(ProcessSerialNumber)
  137.  
  138. Reply parameters
  139. ----------------
  140. keyErrorNumber        The result code for the event
  141.                     Descriptor type            typeLongInteger
  142.                     Optional (the abscence of parameter means no error happened)
  143.                     Size                    4 bytes
  144. ********************************************************************************
  145. */
  146.